package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {


	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000117672273";
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVm4DMHH5h+jLEhyYZtSX5oeSQuTnwn8LLDRX4bwy81iPLa4RHqKGBRWulm+oCbRIHOkVkx64piomIi0DTSQ5ZxQ7uCcB8tbYsDuh0YcSpNIJOZNdD0KqExvYcQ4fRep77puZ4zJCceC4wkQ9P/q5+jfH1b1yKdQ3HOpxWt989qSPNVZT+qmZg5S/Y/lmZWspYGe/pIfXdpg4mzmug035r4VG2yQQH8jMB2zCP1irQqp6lwF+92tzNbpK2KrZ5465n9AGU1PoVrvGSEQ5i67ppmCF3MccarYZohQkvRvTUagyw4S6oITr1t2eO+iEnzCV65H74MOBsUbxWWXcbXA1zAgMBAAECggEAXLq22Uyr9TSsNO4D6plCQXlb/2wfgoqzpUGmJYdHYOBl7Vbl9biK6mJJ96stH3XVX895ZZ7yz2LEHnMZqhw1HeUrfNVkjqfek25mHITg7XPTdJ3CY5E5r/TWZOxiia+0TQzE+4jn9WP0VTwEPrQAGgcHOvZcaKFm+d7VOlbbsw5pAcDHID4XTVy7QCLbmXZoGBYLMC6o2dkjIOVW0yuaK6aT510Ea1LOAoiNE62GvOUDCSGnowVDZrI/l759oZPFHcl4rle+XwYnipMrtIxTlEgBrwUTN5ayx12/RVRqoq5A7psS03he4orm4Ndh0xUgg0yInOMAr0ZLeOGXhSOfEQKBgQDTgB0UOweiawNnyXm0SJy5KUAHbnAVKsYSs/2HUNwFt2wlg7AOC2W7Oi7JdY15/mq9HvBQ83d9U12EMdPAdXSFoDcd2ZZsGNIDVxKf2FMMpX2QZOFR3dK7zM3Qd8DL9Pmy1XEjo5yH3RAapHwziWTNgwAvB5dcdCWIJkhu5qJz2wKBgQC1FbGZiBQ7fzmFyBn1S0jk1OSwe7EIdLKp3elz/5YVBAliIkPSv756zyaMHr+VqaI6Ag2rTOmukbVO3K7N72bBD+TUZ97Tnyv7Nu/lsrWeE30GiY168xg/blSeyUKjd9UC84fhol4G/b6g3mCk6GdowS0b607rZ67mTfhJiSxMSQKBgBR5Kldy/2IxibraPfW9sa4a2B/gCOmDonjdA4W9xg6nmshm3vv9DnP5Rd4qiu9sOVjlTc4IQ2DWWQ8a46yVshndUHiLP4xnOq0oGJ1wi1mGC4mWulj6aBPV13Z+oSMdK66sCq+wfs6ID68EjSFQA3oBXFsxGO3SMG/lhM13dfJRAoGAcAS8eYpJYcjA77YqAKiSriPYWCgcCmwOPbBuAvjfgZ6eo1so84zzqwrMAK/guhdWqGWuyQHqKLgwHVm8tN3chZ9sYczjdauoTF3epwwW93N8yvd6Us1geZSpuhQsKe0uEwZNT1HesppzOxZ1WG3/0jh1zCiTCGJ6OjOPXQYDJikCgYEAxyNI34EscYaPptOoUeLHIQcnCpPgZqoU+WDZ7lB+ybxWZuxyu6aLO3qF/DfgPAJaXWQ8L8x2IzgZXzdjF1CxfQUvFYzW0m0jSgkmW0WLTXRFV7kuPUbpVioDff3qrrI6HQb8LRQvZmakOoqEZBv92szCU3W46O+l1J0sB/1N3JA=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqSCdBes4T0pmwzRbpfdfyvoYG0K9sdXWzrohRBA2rx1a0QzaunAfvXmVmQ3rbs6WElc4GU8GPqvl4Mqk04Xmi3Bo5B2/gdhhP0QcVOT7IaUXIPHD4caEK0OjkSTAyzpjZNQjAxSh7w8lma3D178HbxzmtyDzyU12kuCwK5C07CgyZ0yJGMvjRh78TeSvIS2y708ck6a2cnCf3642F3MiILRIFif7S4iXuaSOSKKr7qzZtxxcb/KzCLVzdxPzVqouZ5ej42UAVxS1o+ZP7yBLA0plkC33ADeP+QMOx6B4kP2t5c8yxOTyP2uRjfc1TOSoi1Cqj/lXDY1Tu6GtUeAOQQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://zal.free.idcfengye.com/final_kele_war_exploded/pay/alipay_notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/final_kele_war_exploded/payLog/endOrder";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";

	

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

